import {Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn} from "typeorm";
import {ApiProperty} from "@nestjs/swagger";

@Entity('sys_blogs_tags')
export class BlogTagEntity {
	@PrimaryGeneratedColumn({ type: 'bigint' })
	id: number

	@Column({ type: 'bigint', name: 'tag_id', comment: '标签id' })
	tagId: number

	@Column({ type: 'bigint', name: 'blog_id', comment: '博客id' })
	blogId: number

	@CreateDateColumn({ type: 'timestamp', name: 'create_date', comment: '创建时间',
		precision: 0,default:()=>'CURRENT_TIMESTAMP(0)'})
	@ApiProperty({ description: '创建时间' })
	createDate: Date

	@UpdateDateColumn({ type: 'timestamp', name: 'update_date', comment: '更新时间',
		precision: 0,default:()=>'CURRENT_TIMESTAMP(0)',onUpdate:'CURRENT_TIMESTAMP'
	})
	@ApiProperty({ description: '更新时间' })
	updateDate: Date
}
